package com.qunar.flight.myserver;

import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;

public class ServerN {
	public static void main(String[] args) {
		try {
			ServerSocketChannel ssc = ServerSocketChannel.open();
			Selector sel=Selector.open();
			ssc.socket().setReuseAddress(true);
			ssc.socket().bind(new InetSocketAddress(8000));
			
			Dispatcher d=new Dispatcher1(sel);
//			Acceptor ac=new Acceptor(ssc, d);
//			new Thread(ac).start();
			new Thread(d).start();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
